'use strict';
/* Controller for deleting  an existing entry*/


blogApp.controller  ('deleteCtrl', ['$scope', '$http','$state',
    function($scope, $http, $state) {
        $scope.deleteEntry = function(id) {
            $http({
               url: 'entries/'+id,
               method: "delete",
               }).success(function() {
                console.log("Deleted");
                $state.go('listAdmin', null, {reload:true});
            });


        };
      }
    ]);

